package com.sttk.secreconeclick.bookkeep;

import android.os.Bundle;
import android.widget.FrameLayout;

import androidx.annotation.Nullable;
import androidx.databinding.ViewDataBinding;

import com.lzb.basic.utils.StatusBarUtils;
import com.sztle.admodule.apiprocessor.OutIntAdApi;
import com.sztle.admodule.apiprocessor.OutNativeApi;


public abstract class BaseAc<DB extends ViewDataBinding> extends BaseNoModelActivity<DB> {
    @Override
    protected void onCreate(@Nullable Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        StatusBarUtils.with(this).init();
        StatusBarUtils.setStatusBarTranslate(this);
        //设置状态栏字体颜色
        StatusBarUtils.setSystemStatusTextColor(isStatusBarTextDark(), this);

        if (isNeedAd()) {
            checkIntAd();
        }
        checkNativeAd();
    }

    protected boolean isStatusBarTextDark() {
        return true;
    }

    protected boolean isNeedAd() {
        return true;
    }


    protected void checkIntAd() {
        OutIntAdApi.showSingleIntAd(this, getLocalClassName().toLowerCase().replace("activity", ""));
    }

    protected void checkNativeAd() {
        if (getNativeView() == null) {
            return;
        }
        OutNativeApi.showNativeAd(this, getNativeView(), getLocalClassName().toLowerCase().replace("activity", ""));
    }

    public FrameLayout getNativeView() {
        return null;
    }
}
